# -- coding: utf-8 -- 

# manhua作品首页索引
import os
import json
def create_manhua_works_index(path='../static/man_hua/'):
    '''
    创建作品索引
    '''
    output = [dI for dI in os.listdir(path) if os.path.isdir(os.path.join(path,dI))]
    js1=json.dumps(output,sort_keys=True, indent=4,separators=(',', ': '),ensure_ascii=False)
    f=open(path+'index.json','w',encoding="utf8")
    f.write(js1)
    f.close
if __name__=='__main__':
    create_manhua_works_index()
    'python manhua_work_index.py'